<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>proxy</title>
</head>

<body>
  <script type="text/javascript">
    let count = 0
    const _proxy = object => {
      // 补全代码
      let proxy = new Proxy(object, {
        get: function (target, propKey) {
          if (propKey in target) {
            count++
          } else {
            count--
          }
        }
      })
      return proxy
    }
  </script>
</body>

</html>